package com.minimalist.basic.entity.vo.operatorlog;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 11987
 */
@Data
@Schema(name = "操作日志管理实体")
public class OperatorLogVO implements Serializable {

    @Schema(name = "operatorLogId", description = "操作日志id", type = "string")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long operatorLogId;

    @Schema(name = "name", description = "执行方法名称", type = "string")
    private String name;

    @Schema(name = "uri", description = "请求URI", type = "string")
    private String uri;

    @Schema(name = "method", description = "请求方式", type = "string")
    private String method;

    @Schema(name = "userAgent", description = "用户代理", type = "string")
    private String userAgent;

    @Schema(name = "ip", description = "请求IP", type = "string")
    private String ip;

    @Schema(name = "params", description = "请求参数", type = "string")
    private String params;

    @Schema(name = "requestTime", description = "请求时间", type = "string")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime requestTime;

    @Schema(name = "exceedTime", description = "请求时长(ms)", type = "string")
    private String exceedTime;

    @Schema(name = "result", description = "执行结果", type = "string")
    private String result;

    @Schema(name = "status", description = "状态  0：失败   1：成功", type = "string")
    private Integer status;

    @Schema(name = "creatorName", description = "操作人", type = "string")
    private String creatorName;
    private Long createId;
}
